/*! 
 * Header file for a collision sphere.
 *
 * \author Devis Rossini
 * \date 19 March 2012
 */
#ifndef PHXCOLLISIONSPHERE_H_INCLUDE_GUARD
#define PHXCOLLISIONSPHERE_H_INCLUDE_GUARD

#include "PhxCollisionPrimitive.h"
#include "PhxCollisionPrimitiveDescriptor.h"

namespace phx
{	
	/*!
	 * Sphere descriptor.
	 */
	struct CollisionSphereDescriptor : public CollisionPrimitiveDescriptor
	{
		/*! 
		 * Constructor.
		 */ 
		CollisionSphereDescriptor()
			: mRadius(0) { }

		/*!
		 * Destructor (virtual).
		 */
		~CollisionSphereDescriptor() { }

		/*!
		 * Return the shape type.
		 */
		virtual ShapeTypes GetShapeType() const { return SPHERE_SHAPE; }

        /*!
         * Radius of the sphere.
         */
		real mRadius;
	};

	/*!
     * Represents a rigid body that can be treated as a sphere
     * for collision detection.
     */
    class CollisionSphere : public CollisionPrimitive
    {
    public:

		/*! 
		 * Constructor.
		 */ 
		CollisionSphere() { }

		/*!
		 * Constructor (with descriptor).
		 */
		CollisionSphere(const CollisionSphereDescriptor& desc) 
			: CollisionPrimitive(desc), mRadius(desc.mRadius) { }

		/*!
		 * Destructor (virtual).
		 */
		virtual ~CollisionSphere() { }

		/*!
		 * Return the shape type.
		 */
		virtual inline ShapeTypes GetShapeType() const { return SPHERE_SHAPE; }

        /*!
         * Radius of the sphere.
         */
        real mRadius;
    };
}

#endif // PHXCOLLISIONSPHERE_H_INCLUDE_GUARD